#========================================================================
#
# Main xpdf Makefile.
#
# Copyright 1996-2003 Glyph & Cog, LLC
#
#========================================================================

# includes basic building rules
# REL_ADDR has to be defined, because Makefile.rules refers 
# to the Makefile.flags
REL_ADDR = ../../
include $(REL_ADDR)/Makefile.rules

HEADERS = \
	xpdf-aconf.h \
	xpdf-aconf2.h

all: libxpdf

staticlib: libxpdf

extralib: libxpdf-extra

libxpdf:
	cd goo && $(MAKE)
	cd fofi && $(MAKE)
	cd splash && $(MAKE)
	cd xpdf && $(MAKE) staticlib

libxpdf-extra:
	cd xpdf && $(MAKE) extralib

.PHONY: install-dev uninstall-dev
install-dev:
	$(MKDIR) $(INSTALL_ROOT)$(INCLUDE_PATH)
	$(COPY_FILE) $(HEADERS) $(INSTALL_ROOT)$(INCLUDE_PATH)
	cd goo && $(MAKE) install-dev
	cd fofi && $(MAKE) install-dev
	cd splash && $(MAKE) install-dev
	cd xpdf && $(MAKE) install-dev

uninstall-dev:
	cd goo && $(MAKE) uninstall-dev
	cd fofi && $(MAKE) uninstall-dev
	cd splash && $(MAKE) uninstall-dev
	cd xpdf && $(MAKE) uninstall-dev
	cd $(INSTALL_ROOT)$(INCLUDE_PATH) && $(DEL_FILE) $(HEADERS)

clean:
	-cd goo && $(MAKE) clean || true
	-cd fofi && $(MAKE) clean || true
	-cd splash && $(MAKE) clean || true
	-cd xpdf && $(MAKE) clean

distclean: clean
	$(DEL_FILE) aconf.h || true
	$(DEL_FILE) Makefile goo/Makefile xpdf/Makefile fofi/Makefile splash/Makefile || true
	$(DEL_FILE) goo/Makefile.in.bak fofi/Makefile.in.bak splash/Makefile.in.bak xpdf/Makefile.in.bak || true
